package com.usian.user.controller.v1;

import com.usian.common.dtos.ResponseResult;
import com.usian.model.user.dtos.AppLoginDto;
import com.usian.user.service.IApUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * app用户登录功能
 */
@RestController
@RequestMapping("/api/v1/login")
public class ApUserLoginController {

    @Autowired
    private IApUserService apUserService;

    /**
     * 登录
     * @return
     */
    @PostMapping("/login_auth")
    public ResponseResult<Map> login(@RequestBody AppLoginDto dto){
        Map<String,Object> map =apUserService.login(dto);
        return ResponseResult.ok(map);
    }

}
